﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="msBsc.WebUi.wfCustomerViewDataInfo"
    CodeBehind="wfCustomerViewDataInfo.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
    <title>用户访问信息</title>
    <link href="/jqPlugin/jqTab/ui.tabs.css" rel="stylesheet" type="text/css" />

    <script src="/jqPlugin/jqTab/ui.tabs.js" type="text/javascript"></script>

    <link href="/jqPlugin/kindeditor/themes/default/default.css" type="text/css" rel="stylesheet" />
    <link href="/jqPlugin/SelectSimu/css/base.css" rel="stylesheet" />
    <script src='/??jqPlugin/kindeditor/kindeditor.js,jqPlugin/kindeditor/lang/zh_CN.js'
        type='text/javascript'></script>
    <script src="/jqPlugin/js/jBase.js"></script>
    <script src="/jqPlugin/js/jBPage.js"></script>
    <script src="/jqPlugin/js/laytpl.js"></script>
    <script src="/jqPlugin/SelectSimu/js/SelectSimu.js"></script>
    <!--end JS引用-->


</head>
<body>
    <form id="wfConstantHandle" method="post" runat="server">
        <asp:HiddenField ID="txtStatus" runat="server" Value="0" />
        <div style="width: 100%; text-align: left; margin: 0px 0px 0px 0px;">
            <div id="container2" style="width: 100%; margin-top: 3px; display: none;">
                <div id="fragment1">
                    <div id="divCondition" style="margin: 0px; border-style: solid; border-width: 1px; border-color: #C8D2E0;">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="label" width="100px" align="right">访问日期</td>
                                <td class="label" width="130px" align="right">
                                    <asp:TextBox ID="txtINITIAL_DT_S" runat="server" Width="130px"></asp:TextBox>
                                </td>
                                <td class="label" width="20px" align="right">至</td>
                                <td class="label" width="130px" align="right">
                                    <asp:TextBox ID="txtINITIAL_DT_E" runat="server" Width="130px"></asp:TextBox>
                                </td>
                                <td align="center">
                                    <input type="button" onclick="javascript: btnDo('mFinder'); return false;" value="查询(F)"
                                        id="btnFinder" accesskey="F" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="bigbox2" style="margin: 0px; margin-top: 2px;">
                        <div id="gridbox1" style="border: 0px solid #cccccc; background-color: #f3f3f3; padding: 5px;">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>

    <script type="text/ecmascript">
        K = KindEditor;
        //        K.DEBUG = true;
        K.basePath = K.options.basePath = '/jqPlugin/kindeditor/';
        K.options.themesPath = K.options.basePath + 'themes/';
        K.options.langPath = K.options.basePath + 'lang/';
        K.options.pluginsPath = K.options.basePath + 'plugins/';

        var jlueditor7 = function () {
            var editor = new Sigma.Editor();
            var input = Sigma.$e('input', { type: 'text', value: editor.defaultValue || '', className: 'gt-editor-text', style: { width: '78px', styleFloat: 'left' } });
            var button = Sigma.$e('input', { type: 'button', value: editor.defaultValue || '', className: 'gt-editor-date', styleFloat: 'left' });
            editor.dom.style.overflow = 'hidden';
            editor.dom.appendChild(input);
            editor.dom.appendChild(button);

            editor.setSize = function (w, h) {
                this.width = w || this.width;
                this.height = h || this.height;
                if (this.width / 1 && this.width > 0) {
                    this.dom.style.width = (this.width - 1) + 'px';
                }
                if (this.height / 1 && this.height > 0) {
                    this.dom.style.height = (this.height - 1) + 'px';
                }
                this.dom.firstChild.style.width = (this.width - 20) + 'px';
            };


            var fillDate = function (imgurl, editorfile) {
                $(input).val(imgurl);
                editor.onClose && editor.onClose();
                editorfile.hideDialog();
            };

            var showCalendar = function () {
                var editorfile = K.editor({
                    allowFileManager: true
                });
                editorfile.fileManagerJson = '/pgajax.axd?F_MANA=1&rType1=0&rType2=0&COOKATHID=' + (typeof (cookesc) == "undefined" ? "" : cookesc)
                                    + "&fType=" + "image";
                editorfile.loadPlugin('filemanager', function () {
                    editorfile.plugin.filemanagerDialog({
                        viewType: 'VIEW',
                        dirName: 'image',
                        clickFn: function (url, title) {
                            fillDate(url, editorfile);
                        }
                    });
                });

            };
            Sigma.U.addEvent(button, 'click', showCalendar);

            editor.valueDom = input;
            return editor;
        };


        //要自定义显示，比如链接等字段如下buynow,在renderer函数中返回要显示的HTML编码字符
        var colsOption = [
        { id: 'COUNTRY_NAME', header: "点击者国家", width: 130 },
        { id: 'PROVINCE_NAME', header: "点击者城市", width: 130 },
        { id: 'CITY_NAME', header: "点击者地区", width: 130 },
        { id: 'S_COUNTRY', header: "被查看者国家", width: 130 },
        { id: 'S_CITY', header: "被查看者城市", width: 130 },
        { id: 'CUSTOMER_VIEW_PAGE', header: "页面名称", width: 130 },
        { id: 'VIEW_NUM', header: "查看次数", width: 130 },
        ];

        //以下为固定的代码
        var gridOption1 = getGtOp('myGrid1', colsOption, 'gridbox1', 'BANK_ID');
        var mygrid1 = new Sigma.Grid(gridOption1);
        //////////////////////////////////////////////////////////
        function btnDo(sEbtn) {
            GtGrid1Action = sEbtn;
            var opart = GetGtParam("myGrid1");
            if (sEbtn == "mFinder") {
                doFinderGt('myGrid1');
            }
            else if (sEbtn == "btnEdit") {
                opart.AddCell("sEditMode", "EDIT");
                ajaxComm(opart, null, null, 'divCondition'); //调用页面回调，并传入参数
            }
            else if (sEbtn == "btnSave") {
                doSaveGt('myGrid1');
            }
            else if (sEbtn == "btnConfirm" || sEbtn == "btnCancel") {
                var sidtem1 = GetGtSelectId('myGrid1');
                if (sidtem1) {
                    opart.AddCell("CHECK_ID", sidtem1);
                    ajaxComm(opart, null, null, 'divCondition'); //调用页面回调，并传入参数
                } else {
                    alert("请先选择记录！");
                }
            }
            else {
                ajaxComm(opart, null, null, 'divCondition'); //调用页面回调，并传入参数
            }
            GtGrid1Action = "";
        };

        $(window).load(function () {
            $('#txtINITIAL_DT_S').date_input('%Y-%m-%d');
            $('#txtINITIAL_DT_E').date_input('%Y-%m-%d');
            //初始化步进式搜索框
            $('#container2').fadeIn("fast"); //初始化TAB页选择控件
            $('#container2 ul').tabs();
            mygrid1.render();
            mygrid1.readOnly = true;
            autogtResize("bigbox2", mygrid1);
            SetBtnEnable('btnEdit', 'btnSave,btnNotSave,btnConfirm,btnCancel');
        });

        setArea("outerInner", 200, 1, 1, ["DF6723BE-A25C-4F77-BB49-A1662D3E6F2A"], ["中国"]);
        setArea("province", 200, 2, 1, ["AEF39D8E-D298-4AF1-AEC5-2B00D237F5F5"], ["北京"]);
        setArea("city", 200, 3, 1, [""], ["全部"]);
        var parentsId = "00000000-0000-0000-0000-000000000000";
        var GtGrid1Action;



        function GetGtParam(jqGridID) {
            var _jsParam = new jsonRow();
            if (jqGridID == "myGrid1") {
                GetFormJson("divCondition", _jsParam);
                _jsParam.AddCell("PPAGE", "wfConstantHandle"); //这个地方是该页面的类名
                _jsParam.AddCell("gtGridID", "myGrid1");
                _jsParam.AddCell("sRadom", $("#sRadom").val());
                _jsParam.AddCell("txtStatus", $("#txtStatus").val());
                _jsParam.AddCell("txtSearchCT", $("#txtSearchCT").val());
                _jsParam.AddCell("ACTION", GtGrid1Action);
                _jsParam.AddCell("S_DATE", $("#txtINITIAL_DT_S").val());
                _jsParam.AddCell("E_DATE", $("#txtINITIAL_DT_E").val());
                _jsParam.AddCell("isAll", jqGridID);
                //这里可增加传入后台的参数
            } return _jsParam;
        };
    </script>
</body>
</html>
